<!DOCTYPE html>
<html>
<head>
	<title>管理登录</title>
	<link rel="stylesheet" href="/static/css/base.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/caipiao_3.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/icon.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/hjh.css" type="text/css" />
	<link rel="stylesheet" href="/static/css/caipiao.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/caipiao_1.css" type="text/css" />
    <link rel="stylesheet" href="/static/css/easydialog.css" type="text/css" />
	<script src="/static/js/easydialog.js" type="text/javascript"></script>
  	<script src="/static/js/jquery.min.js" type="text/javascript"></script>
  	<script src="/static/js/pyqtmock.js" type="text/javascript"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	
	<style type="text/css">
		.login_btn{
			margin-top:20px;
			background:url('/static/img/login_btn.png') no-repeat;
		}
	</style>
	
	<script type="text/javascript">
	    var lottery;
	    $(document).ready(function(){
	    	$('#ecard_code').focus();
	    	$('#ecard_code').bind('input',function(){
	    		ecard_value = $(this).val();
	    		if(ecard_value.length>9){
	    			$('#acc_num').val(ecard_value.slice(1,9));
	    			$('.input_keybord').show();
	    		}
	    	});
	    	
			$('body').click(function(){
				if(event.target.id == 'backbtn'){
					return;
				}
				if($('#acc_num').val()==''){
					$('#err_msg').html("请先刷卡");
                	easyDialog.open({
	              		  container : 'msg_display',
	              		  autoClose : 1000,
	              		  fixed : false,
	              		  countid : 'inputpwd_time'
	              	});
					$('#ecard_code').focus();
	    		}
			});
	    	
	    	$('#password').focus(function(){$('.input_keybord').show();});
	    	//$('#password').focus(function(){$('.input_keybord').show();});
	    	//$('#acc_num').blur(function(){$('.input_keybord').show();});
            $('#acc_num').focus(function(){$('.input_keybord').hide();});

	    	//软键盘数字键
	        $('i.bottom').click(function(){
	            //console.log($(this).children().html());
	            $('#password').val($('#password').val()+$(this).children().html());
	        });

	        //软键盘删除键
	        $('i.dele').click(function(){
	            var c = $('#password').val();
	            $('#password').val(c.slice(0,c.length-1));
	        });

	        //软键盘清空键
	        $('i.rest').click(function(){
	           $('#password').val(''); 
	        });
	    });
	    
	    function chk_login(){
	    	$.ajax({
                type:'POST',
                dataType:'json',
                url:'/chk_login',
                data:{
                    acc_num : $('#acc_num').val(),
                    password : $('#password').val(),
                    mac:pyObj.get_if_mac()
                },
                success:function(data,status){
                	window.location.href="/guanli"
                },
                error:function (req, status, error){
                	$('#err_msg').html(req.responseText);
                	easyDialog.open({
	              		  container : 'msg_display',
	              		  autoClose : 1000,
	              		  fixed : false,
	              		  countid : 'inputpwd_time'
	              	});
                },
            });
	    }
  </script>
</head>

<body oncontextmenu="return false">
 <div id="guanli_denglu">
	<span class="guanli_denglu_logo"></span>
      <span class="guanli_denglu_title"></span>
    <div id="backbtn" class="back_img right inline" onclick="window.location.href='/index'"></div>
 </div>
  
  	<!-- 登录 -->
	<div class="daigou_1" style="height:396px;margin-left:459px;width:395px;" id="login">
	  <div class="daigou_11" style="height:396px;">
	    <div class="daigou-info">
	    	<input id="ecard_code" type="text" value="" class="scaninput"/>
	    	<span style="margin-left:15px;">账号</span><br><input id="acc_num" type="text" class="input" style="margin-top:10px;" readonly="readonly">
	    </div>
	    <div class="daigou-info2" style="margin-top:10px;"><span style="margin-left:15px;">密码</span><br><table>
	        <tbody><tr><td><input id="password" type="password" class="input" style="margin-top:10px;"></td></tr>
	        	<tr><td><a id="login_submit" onclick="chk_login();" class="daigou_ok-button login_btn"></a></td></tr>
	      </tbody></table> </div>
	  </div>
	
	  <div class="input_keybord" style="display:none;top:-355px;">
	    <i class="bottom"><span>7</span></i>
	    <i class="bottom"><span>8</span></i>
	    <i class="bottom"><span>9</span></i>
	    <br>
	    <i class="bottom"><span>4</span></i>
	    <i class="bottom"><span>5</span></i>
	    <i class="bottom"><span>6</span></i>
	    <br>
	    <i class="bottom"><span>1</span></i>
	    <i class="bottom"><span>2</span></i>
	    <i class="bottom"><span>3</span></i>
	    <br>
	    <i class="bottom"><span>0</span></i>
	    <i class="dele"><span></span></i>
	    <i class="rest"><span></span></i>
	  </div>
	</div>

	<div class="toubi_1" style="display:none;height: 121px;" id="msg_display">
		<div class="toubi_11" style="height: 121px">
			<div class="print-tikect"><span class="like-red" id="err_msg"></span></div>
			<div><span id="inputpwd_time" style="margin-left:200px;">2</span>秒后返回主界面</div>
		</div>
	</div>
</body>
</html>
